<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/font-awesome.css">
	<link rel="stylesheet" href="css/style.css">
</head>
<body >

	<div class="container" style="margin:20px auto; ">
		<div class="content">
        	<div class="header">
	            <div class="stats">
				    
				    <p class="stat">
				    	<span class="number">
				    		<a href="/sign.jspx"><i class="icon-user"></i> 注册</a>	
				    	</span>
				    </p>
				    
				    <p class="stat">
				    	<span class="number">
				    		<a href="#"><i class="icon-home"></i> 首页</a>
				    	</span>
				    </p>
				</div>
				<h1 class="page-title"><i class="icon-github"style="padding-right:10px"></i>项目管理系统</h1>
	        </div>
        	<!-- head end-->
        	
        	<ul class="breadcrumb">
	            <li><a href="index.html">首页</a> <span class="divider">/</span></li>
	            <li class="active">用户注册</li>
	        </ul>

	        <div class="container-fluid">

	        	
	        	<div class="row-fluid">
				    <div class="dialog">
				        <div class="block">
				            <p class="block-heading">注册系统</p>
				            <div class="block-body">
				                <form action="sign.jspx" method="post">
				                    <label>请输入账号</label>
				                    <input type="text" class="span5" name="username" id="in1">
				                    <span id="span"></span>
				                    <label>输入密码</label>
				                    <input type="password" class="span5" name="pwd"id="in2">
				                    <label>确认密码</label>
				                    <input type="password" class="span5"id="in3">
				                    <span id="span2"></span>
				                    <br/>
				                    <button type="button" onclick="location.back()" class="btn pull-left">返回</button>
				                    <button type="button" class="btn btn-primary pull-right" id="btn">注册</button>
				      
				                    <div class="clearfix"></div>
				                </form>
				            </div>
				        </div>
				    </div>
				</div>
				<footer>
	                <hr>
	                <p>© 2013 <a href="http://weibo.com/u/2821897085?wvr=5&lf=reg" target="_blank">ZYF制作</a></p>
	            </footer>
	        </div>
        </div>
	</div>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			
			$("#in1").blur(function(){
				var name = $(this).val();
				$.get("/checkname.jspx?name="+name,function(date){
					if(date=="yes"){
						$("#span").attr("style","color:green;");
						$("#span").text("可以注册");
					}else{
						$("#span").attr("style","color:red;").text("已被占用");
					}
				});
			});
			
			$("#btn").click(function(){
				if($("#in2").val() == $("#in3").val()){
					if($("#span").text()=="可以注册"){
						$("form").submit();
					}
				}else{
					$("#span2").attr("style","color:red;").text("两次密码不一致");
				}
			});
		});
	</script>
</body>
</html>
